/*
 * Eugen Stoian <stoian.e@gmail.com> 2010
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef EXPRESSION3DFORM_H
#define EXPRESSION3DFORM_H

#include <QtGui/QWidget>
namespace Ui {
    class Expression3DForm;
}
class Expression3D;
class Expression3DForm : public QWidget {
    Q_OBJECT
public:
    Expression3DForm(QWidget *parent = 0);
    ~Expression3DForm();
    bool isModified() const {
        return _modified;
    }
public slots:
    void setExpression(Expression3D* expr);
    void revert();
    void apply();
protected slots:
    void onNameChanged(const QString& name);
    void onVarsChanged(const QString& vars);
    void onXExpressionChanged(const QString& expr);
    void onYExpressionChanged(const QString& expr);
    void onZExpressionChanged(const QString& expr);
signals:
    void modified(bool);
protected:
    void changeEvent(QEvent *e);
private:
    void init();
private:
    Ui::Expression3DForm *m_ui;
    Expression3D * _expression;
    QString _expressionName;
    QString _xExpression;
    QString _yExpression;
    QString _zExpression;
    QString _vars;
    bool _modified;
};

#endif // EXPRESSION3DFORM_H
